package com.example.discover

import com.example.discover.model.Subject
import com.example.discover.dao.SubjectDao
import com.example.featuresdk.database.DatabaseCallback
import com.example.featuresdk.model.IconManager
import javax.inject.Inject

class DiscoverDatabaseCallback @Inject constructor(private val subjectDao: SubjectDao): DatabaseCallback() {

    init {
        this.priority = 10
    }

    override suspend fun initialize() {
        super.initialize()

        subjectDao.insert(
            IconManager.icons.map {
                Subject(title = it.key, logo = it.value)
            }
        )
    }
}